package com.zzw.redis;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;

import java.util.List;

@Component
public class ResdisConsumer {

    @Autowired
    private JedisPool pool;

    public void consumer(){
        Jedis jedis = pool.getResource();
        List<String> temp = jedis.brpop(0, "test", "test2");
        while (temp != null) {
            List<String> list = jedis.brpop(0, "test", "0");
            System.out.println(list);
        }
    }

}
